var pager = function(e) {
    var t = {},
    n = {},
    r = e.pages,
    i = function() {
        $.each(r, 
        function(e, r) {
            var i = $("#" + r),
            s = i.offset();
            t[r] = s.top,
            n[r] = [s.top, s.top + i[0].offsetHeight];
        });
    };
    i();
    var s = function() {
        var e = $(window).scrollTop(),
        t = document.documentElement,
        n = self.innerHeight || t && t.clientHeight || document.body.clientHeight,
        r = [e, e + n];
        return r;
    },
    o = function() {
        var e = s(),
        t,
        r,
        i = 0;
        for (var o in n) if (n.hasOwnProperty(o)) {
            var u = o,
            a = [];
            r = n[o],
            a[0] = Math.max(e[0], r[0]),
            a[1] = Math.min(e[1], r[1]);
            var f = a[1] - a[0];
            f > i && (i = f, t = u);
        }
        return {
            target: t
        };
    };
    return {
        getCurrentPage: o
    };
}; 
(function() {
    var e = [],
    t = function(e) {
        var e = $("#" + e);
        e.find(".guidehide").removeClass("guidehide").addClass("animate");
    };
    $(".section").each(function(t, n) {
        e.push(n.id);
    });
    var n = {
        pages: e
    },
    r = pager(n),
    i;
    t(r.getCurrentPage().target),
    $(window).on("scroll", 
    function() {
        clearTimeout(i),
        i = setTimeout(function() {
            t(r.getCurrentPage().target);
        },
        50);
    });
})();